package com.example.rlw.mvpplugintest.collapsing;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.rlw.mvpplugintest.R;
import com.example.rlw.mvpplugintest.adapter.MyPagerAdapter;
import com.example.rlw.mvpplugintest.mvp.MVPBaseActivity;
import com.example.rlw.mvpplugintest.mvp.MVPBaseFragment;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 描述：
 * Created by rlw on 2019/3/8.
 */
public class CollapsingActivity extends MVPBaseActivity {
    @BindView(R.id.viewPager)
    ViewPager viewPager;
    @BindView(R.id.imageView_header)
    ImageView mImageViewHeader;
    @BindView(R.id.toolbar_title)
    TextView mToolbarTitle;
    @BindView(R.id.toolbar)
    Toolbar mToolbar;
    @BindView(R.id.tabLayout)
    TabLayout mTabLayout;
    @BindView(R.id.collapsing_toolbar)
    CollapsingToolbarLayout mCollapsingToolbar;
    @BindView(R.id.app_bar)
    AppBarLayout mAppBar;
    private List<String> title;


    @Override
    protected int getLayoutId() {
        return R.layout.collapsing_activity_layout2;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData(@Nullable Bundle savedInstanceState) {
        List<MVPBaseFragment> list = new ArrayList<>();
        title = new ArrayList<>();
        title.add("tab1");
        title.add("tab2");
        title.add("tab3");
        list.add(new TestFragment());
        list.add(new TestFragment());
        list.add(new TestFragment());
        viewPager.setAdapter(new MyPagerAdapter(getSupportFragmentManager(), list, title));
        mTabLayout.setupWithViewPager(viewPager);
    }

    @Override
    protected void initNet() {

    }

}
